A dynamic adaptive streaming over http (Dynamic Adaptive Streaming over HTTP, DASH for short) solution is a new generation media transmission solution that is promoted by international standards organizations: 3gpp and MPEG. Compared with an existing media transmission solution over http (such as Youku), a biggest difference of the DASH solution lies in that a client (a player end) can perform automatic adjustment according to a network condition, a condition of the client, and so on, and obtain a proper media stream for playing. When the network condition is good, the client may request a media stream of high quality for playing, and when the network becomes worse, the client may request a code stream, which is slightly low in quality and has a smaller bit rate, for playing. In this way, continuous playing at the client can be ensured and user experience can be improved.
A content preparation module located at a server end in a DASH system is responsible for preparing media content, slicing, and generating a media presentation description (Media Presentation Description, MPD for short) file. For example, during preparation of an a. mp4 program, code streams of 2 Mbps, 1 Mbps, and 500 kbps are generated separately to meet adaptive requirements, and corresponding media files are a_2000.mp4, a_1000.mp4, and a_500.mp4. For convenience of switching a code steam by a client at any time, these files further need to be segmented into small segment files (segment), for example, one segment at an interval of five seconds. Media segments generated by generating files of different bit rates are described by using MPD files. After being generated, an MPD file is transferred to an MPD distribution module at a server end for processing; and a media segment file is transferred to a media segment distribution module, that is, an Http Server, at the server end for processing. Steps that a DASH client plays a code stream usually are: A DASH client requests an MPD file from an MPD distribution module, parses the MPD file after obtaining the MPD file, and obtains a proper media segment (segment) for playing from a media segment distribution module according to media description information in the MPD file.
In the foregoing technical solution, when playing a media file, a DASH client needs to request an MPD file from a server end first; however, in some cases, for example, cases in which a duration of a program source is quite long, the number of media segments that are obtained through segmentation is quite large, the MPD file is quite large, which causes that time for the client to download the MPD file is too long. Furthermore, when the MPD file is quite large, the client also needs a certain period of time to parse the MPD file, which causes that time for the client to start playing is too long. Particularly, when this type of solution is applied to a handheld device, due to a limitation caused by a network bandwidth and a hardware capability of the handheld device, it takes a long time to download and parse an MPD file, thereby greatly affecting user experience.